﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="QuestionRoundAdd.aspx.cs" Inherits="ProjectSem40701.Admin.QuestionRoundAdd" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
     <title>Thêm mới câu hỏi vào vòng thi</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
       <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("6"));
    </script>
    <!--
        end set tab active
     -->
     <div id="box">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>      
        <h3>Thêm mới câu hỏi vào vòng thi</h3>
         <fieldset>
            <legend>Chọn câu hỏi vào vòng thi</legend>
            <p>
                <label>Chọn kỳ thi:</label>
                <asp:DropDownList ID="cbbExam" runat="server" Width="120px" AutoPostBack="True" 
                    DataSourceID="ObjectDataSource2" DataTextField="ExamName" 
                    DataValueField="ExamID" ondatabound="cbbExam_DataBound" 
                    onselectedindexchanged="cbbExam_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Exam_Select_All" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.ExamTableAdapters.tbl_ExamTableAdapter">
                </asp:ObjectDataSource>
            </p>
            
            <p>
                <label>Chọn vòng thi:</label>
                <asp:DropDownList ID="cbbRound" runat="server" Width="120px" 
                    AutoPostBack="True" DataSourceID="ObjectDataSource3" DataTextField="RoundName" 
                    DataValueField="RoundID">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Round_Select_All_By_ExamID" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.RoundTableAdapters.tbl_RoundTableAdapter">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cbbExam" Name="exid" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </p>
            <label>Chọn câu hỏi:</label>
            <p>
                 <telerik:RadGrid ID="rgrQuestion" runat="server" AllowFilteringByColumn="True" 
                     AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                     DataSourceID="ObjectDataSource1" Skin="Default">
                        <MasterTableView CellSpacing="-1" DataKeyNames="QuestionID" DataSourceID="ObjectDataSource1">
                            <Columns>
                                <telerik:GridBoundColumn DataField="QuestionID" HeaderText="QuestionID" 
                                    UniqueName="QuestionID" Visible="False">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="QuestionTittle" HeaderText="Tiêu đề" 
                                    UniqueName="column" FilterControlWidth="200px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="SubjectName" HeaderText="Tên môn" 
                                    SortExpression="SubjectName" UniqueName="SubjectName">
                                    <ItemStyle Width="70px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="QuestionMark" DataType="System.Double" 
                                    HeaderText="Điểm" SortExpression="QuestionMark" UniqueName="QuestionMark" 
                                    FilterControlWidth="40px">
                                    <HeaderStyle Width="60px" />
                                    <ItemStyle Width="60px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="QuestionLevelName" HeaderText="Độ khó" 
                                    SortExpression="QuestionLevelName" UniqueName="QuestionLevelName" 
                                    FilterControlWidth="40px">
                                    <HeaderStyle Width="60px" />
                                    <ItemStyle Width="40px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn DataField="QuestionStatus" DataType="System.Int32" 
                                    HeaderText="Trạng thái" SortExpression="QuestionStatus" 
                                    UniqueName="QuestionStatus">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="QuestionStatusTextBox" runat="server" 
                                            Text='<%# Bind("QuestionStatus") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="QuestionStatusLabel" runat="server" 
                                            Text='<%# Eval("QuestionStatus") %>' 
                                            ondatabinding="QuestionStatusLabel_DataBinding"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="60px" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn1">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="linkView" runat="server" 
                                            NavigateUrl='<%# Eval("QuestionID", "QuestionEdit.aspx?qid={0}") %>'>Xem</asp:HyperLink>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn AllowFiltering="False" 
                                    UniqueName="chkbColumnChoose">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkbChoose" runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle Width="30px" />
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <HeaderStyle Wrap="False" />
                 </telerik:RadGrid>
            </p>
             <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                 OldValuesParameterFormatString="original_{0}" 
                 SelectMethod="Get_Question_QuestionLevel_Subject_SelectAll" 
                 TypeName="ProjectSem40701.Admin.AdminXSD.QuestionTableAdapters.Question_QuestionLevel_Subject_SelectAllTableAdapter">
             </asp:ObjectDataSource>
            
         </fieldset>      
    </div>  
    <div id="box" align="center">
        <asp:Button ID="btnAdd" runat="server" Text="Thêm câu hỏi vào vòng thi" 
            onclick="btnAdd_Click" />
        <cc1:ConfirmButtonExtender ID="btnAdd_ConfirmButtonExtender" runat="server" 
            ConfirmText="Bạn có thực sự muốn thêm những câu hỏi này vào vòng thi" Enabled="True" TargetControlID="btnAdd">
        </cc1:ConfirmButtonExtender>
    </div>
    
    <cc1:ModalPopupExtender ID="btnAdd_ModalPopupExtender" runat="server" 
            DynamicServicePath="" Enabled="False" TargetControlID="btnAdd" 
            BackgroundCssClass="modalBackground"
            PopupControlID="pnlPopup">
    </cc1:ModalPopupExtender>
    
    <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
        <div class="inner">
            <h2>
                <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
            </h2>
            <div class="base">
                <asp:Button ID="btnYes" onclick="btnYes_Click" runat="server" Text="Yes" />
                <asp:Label ID="lblSuccess" runat="server" Text="" Visible="False"></asp:Label>
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" 
                    OnClientClick="$find('mdlPopup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>
    
</asp:Content>
